package avicit.bdp.dds.dao.entity;

import avicit.bdp.common.base.BaseDTO;
import avicit.platform6.core.annotation.log.FieldRemark;
import avicit.platform6.core.annotation.log.Id;
import avicit.platform6.core.annotation.log.LogField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.Column;
import javax.persistence.Table;

/**
 * @金航数码科技有限责任公司
 * @作者：developer
 * @邮箱：developer@avic-digital.com
 * @创建时间： 2022-04-27
 * @类说明：TaskNodeType
 * @修改记录：
 * @注意事项：
 * @主要功能：节点与类型映射关系DTO
 */
@ApiModel(value = "TaskNodeType", description = "节点与类型映射关系DTO")
@Table(name = "bdp_dds_task_nodes_type")
public class TaskNodeType extends BaseDTO {
    /**
     * 主键
     */
    @LogField
    @ApiModelProperty(value = "主键")
    @FieldRemark(column = "id", field = "id", name = "主键")
    @Column(name = "id")
    @Id
    @javax.persistence.Id
    private String id;

    /**
     * 节点ID
     */
    @LogField
    @ApiModelProperty(value = "节点ID", name = "nodeId")
    @FieldRemark(column = "node_id", field = "nodeId", name = "节点ID")
    @Column(name = "node_id")
    private String nodeId;

    /**
     * 分类;包括commonFlow、phmModelFlow、phmModelRunFlow、phmTrainFlow、sparkFlow、sparkMLFlow、sparkStreamFlow。
     */
    @LogField
    @ApiModelProperty(value = "编码", name = "type")
    @FieldRemark(column = "type", field = "type", name = "编码")
    @Column(name = "type")
    private String type;

    /**
     * 排序序号
     */
    @LogField
    @ApiModelProperty(value = "排序序号", name = "orderBy")
    @FieldRemark(column = "order_by", field = "orderBy", name = "排序序号")
    @Column(name = "order_by")
    private Integer orderBy;

    /**
     * 算法分类；0：内置算法；1：自定义算法；
     */
    @LogField
    @ApiModelProperty(value = "算法分类", name = "algoType")
    @FieldRemark(column = "algo_type", field = "algoType", name = "排序序号")
    @Column(name = "algo_type")
    private Integer algoType;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getNodeId() {
        return nodeId;
    }

    public void setNodeId(String nodeId) {
        this.nodeId = nodeId;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Integer getOrderBy() {
        return orderBy;
    }

    public void setOrderBy(Integer orderBy) {
        this.orderBy = orderBy;
    }

    public Integer getAlgoType() {
        return algoType;
    }

    public void setAlgoType(Integer algoType) {
        this.algoType = algoType;
    }

    public static Builder builder() {
        return new Builder();
    }

    /**
     * builder构造器
     */
    public static final class Builder {
        private String id;
        private String nodeId;
        private String type;
        private Integer orderBy;
        private Integer algoType;

        private Builder() {
        }

        public static Builder aTaskNodeType() {
            return new Builder();
        }

        public Builder id(String id) {
            this.id = id;
            return this;
        }

        public Builder nodeId(String nodeId) {
            this.nodeId = nodeId;
            return this;
        }

        public Builder type(String type) {
            this.type = type;
            return this;
        }

        public Builder orderBy(Integer orderBy) {
            this.orderBy = orderBy;
            return this;
        }

        public Builder algoType(Integer algoType) {
            this.algoType = algoType;
            return this;
        }

        public TaskNodeType build() {
            TaskNodeType taskNodeType = new TaskNodeType();
            taskNodeType.setId(id);
            taskNodeType.setNodeId(nodeId);
            taskNodeType.setType(type);
            taskNodeType.setOrderBy(orderBy);
            taskNodeType.setAlgoType(algoType);
            return taskNodeType;
        }
    }
}
